package com.demo;

import com.demo.model.User;
import com.demo.service.UserService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.EnableAsync;

import java.util.concurrent.ExecutionException;

@SpringBootApplication
@EnableAsync
public class C8Application {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        ConfigurableApplicationContext contenxt= SpringApplication.run(C8Application.class,args);
        UserService userService=contenxt.getBean(UserService.class);
        User user=userService.addUser(new User("1", "luobiao", 20));
        System.out.println("返回user="+user);

    }
}
